home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Agent Central Host Computer
/
Agent - Central Host Computer.iso
/
_SETUP.1
/
install.bat
< prev
next >
Wrap
DOS Batch File
|
2000-05-26
|
5KB
|
165 lines
@REM RCSVER $Id: $
@ECHO OFF
REM ---------------------------------------------------
REM File: Install.bat
REM Purpose: Create tables, views, and load data for
REM a customer.
REM Author: RNW
REM Date: 05-25-00
REM ---------------------------------------------------
REM ---------------------------------------------------
REM Initialization Section
REM ---------------------------------------------------
REM Set the location of the Oracle SQLPlus
SET PLUSPATH=D:\ORANT\BIN\SQLPLUS.EXE
SET LDRPATH=D:\ORANT\BIN\SQLLDR80.EXE
REM Set the path of the data (CTL) files
SET CTLPATH=C:\agent\oracle\data
REM Set the path of the SQL files
SET SQLPATH=C:\agent\oracle\sql
REM Set the path of the views
SET VIEWPATH=C:\agent\oracle\views
REM Set the location of the log files
SET TSQLLOG=C:\TEMP\SQLLOG1.TXT
SET VSQLLOG=C:\TEMP\SQLLOG2.TXT
SET ERRLOG=C:\TEMP\LOGFILE.TXT
REM Set the default error status
SET ERRSTR=SUCCESSFULLY
REM ---------------------------------------------------
REM Create all necessary directories
REM ---------------------------------------------------
REM Make sure /temp dir exists - we will be creating the logfile there
IF NOT EXIST C:\TEMP MKDIR C:\TEMP
ECHO STARTING PROCESSING > %ERRLOG%
REM ---------------------------------------------------
REM Make sure SQLPlus path is correct - try other dirs if needed
REM ---------------------------------------------------
IF EXIST %PLUSPATH% GOTO CONTP
SET PLUSPATH=C:\ORANT\BIN\SQLPLUS.EXE
IF EXIST %PLUSPATH% GOTO CONTP
SET PLUSPATH=D:\ORAWIN95\BIN\SQLPLUS.EXE
IF EXIST %PLUSPATH% GOTO CONTP
SET PLUSPATH=C:\ORAWIN95\BIN\SQLPLUS.EXE
IF EXIST %PLUSPATH% GOTO CONTP
GOTO ERRPLUSP
REM ---------------------------------------------------
REM SQLPlus was found
REM ---------------------------------------------------
:CONTP
ECHO SQLPlus PATH IS %PLUSPATH% >> %ERRLOG%
REM ---------------------------------------------------
REM Make sure SQLLDR path is correct - try other dirs if needed
REM ---------------------------------------------------
IF EXIST %LDRPATH% GOTO CONTL
SET LDRPATH=C:\ORANT\BIN\SQLLDR80.EXE
IF EXIST %LDRPATH% GOTO CONTL
SET LDRPATH=D:\ORAWIN95\BIN\SQLLDR80.EXE
IF EXIST %LDRPATH% GOTO CONTL
SET LDRPATH=C:\ORAWIN95\BIN\SQLLDR80.EXE
IF EXIST %LDRPATH% GOTO CONTL
GOTO ERRLDP
REM ---------------------------------------------------
REM SQLLDR80 was found
REM ---------------------------------------------------
:CONTL
ECHO SQLLDR PATH IS %LDRPATH% >> %ERRLOG%
REM ---------------------------------------------------
REM Run the install script to create the tables
REM ---------------------------------------------------
ECHO CREATING TABLES >> %ERRLOG%
CD %SQLPATH%
%PLUSPATH% agent/agent@CHCagent.agent @install.sql
IF ERRORLEVEL 1 GOTO ERRSQL
ECHO TABLES SUCCESSFULLY CREATED >> %ERRLOG%
REM ---------------------------------------------------
REM Run the install script to create the views
REM ---------------------------------------------------
ECHO CREATING VIEWS >> %ERRLOG%
CD %VIEWPATH%
%PLUSPATH% agent/agent@CHCagent.agent @vinstall.sql
IF ERRORLEVEL 1 GOTO ERRVIEW
ECHO VIEWS SUCCESSFULLY CREATED >> %ERRLOG%
REM ---------------------------------------------------
REM Remove all "BAD" files generated by previous sqlldr80 calls
REM ---------------------------------------------------
DEL %CTLPATH%\*.BAD
REM ---------------------------------------------------
REM Run the install script to load the common data
REM ---------------------------------------------------
ECHO LOADING COMMON DATA >> %ERRLOG%
CD %CTLPATH%
CALL loadcommon.bat %LDRPATH%
IF EXIST %CTLPATH%\*.BAD GOTO ERRCOM
ECHO COMMON DATA SUCCESSFULLY CREATED >> %ERRLOG%
REM ---------------------------------------------------
REM Run the install script to load the customer data
REM ---------------------------------------------------
ECHO LOADING CUSTOMER DATA >> %ERRLOG%
CD %CTLPATH%
CALL loadcust.bat %LDRPATH%
IF EXIST %CTLPATH%\*.BAD GOTO ERRCUST
ECHO CUSTOMER DATA SUCCESSFULLY CREATED >> %ERRLOG%
GOTO END1
REM ---------------------------------------------------
REM Error processing
REM ---------------------------------------------------
:ERRSQL
ECHO ERROR ENCOUNTERED CREATING TABLES >> %ERRLOG%
ECHO SEE THE FILE %TSQLLOG% FOR MORE INFORMATION >> %ERRLOG%
SET ERRSTR=WITH ERRORS
GOTO END1
:ERRVIEW
ECHO ERROR ENCOUNTERED CREATING VIEWS >> %ERRLOG%
ECHO SEE THE FILE %VSQLLOG% FOR MORE INFORMATION >> %ERRLOG%
SET ERRSTR=WITH ERRORS
GOTO END1
:ERRCOM
ECHO ERROR ENCOUNTERED LOADING COMMON DATA >> %ERRLOG%
SET ERRSTR=WITH ERRORS
GOTO END1
:ERRCUST
ECHO ERROR ENCOUNTERED LOADING CUSTOMER DATA >> %ERRLOG%
SET ERRSTR=WITH ERRORS
GOTO END1
:ERRPLUSP
ECHO SQL PATH COULD NOT BE FOUND >> %ERRLOG%
SET ERRSTR=WITH ERRORS
GOTO END1
:ERRLDP
ECHO SQLLDR PATH COULD NOT BE FOUND >> %ERRLOG%
SET ERRSTR=WITH ERRORS
GOTO END1
REM ---------------------------------------------------
REM End
REM ---------------------------------------------------
:END1
ECHO PROCESSING COMPLETED %ERRSTR% >> %ERRLOG%
EDIT %ERRLOG%
EXIT